<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateGoodsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    // 商品表
    public function up()
    {
        Schema::create('goods', function (Blueprint $table) {
            // 编号 图片 价格 类别ID 描述 数量
            $table->increments('id');
            $table->string('image');
            $table->integer('money');
            $table->integer('type_id'); // 1-电视机 2-冰箱 3-空调
            $table->string('title')->nullable();
            $table->integer('number')->default(1);
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('goods');
    }
}
